package com.wzw.springboot.principle.use.batch.simple;

import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.item.ItemProcessor;

import java.util.Locale;

/**
 * Job处理方式
 *
 * @author Wangzhiwen
 */
@Slf4j
public class PersonProcessor implements ItemProcessor<Person, Person> {
    @Override
    public Person process(Person item) throws Exception {
        log.info("Person Name To UpperCase And Age + 1");
        return item.setName(item.getName().toUpperCase(Locale.ROOT)).setAge(item.getAge() + 1);
    }
}
